package sg.edu.nus.iss.team8s.vmcs.gui;

import java.awt.Frame;
import java.awt.Panel;

import sg.edu.nus.iss.team8s.vmcs.builder.MachineryPanel;
import sg.edu.nus.iss.team8s.vmcs.commons.CommonUtility;
import sg.edu.nus.iss.team8s.vmcs.commons.Constant;
import sg.edu.nus.iss.team8s.vmcs.control.MachineryController;
/**
 * 
 * @author Zheng Xiaofeng
 *
 */
public class MachinerySimulatorPanel extends Frame{

	private static final long serialVersionUID = 1L;
	private static final String TITLE = "VMCS - Machinery Panel";
	private MachineryPanel contentPanel = null;
	private static MachinerySimulatorPanel instance = null;
	
	public MachineryPanel getContentPanel() {
		return contentPanel;
	}
	
	public static synchronized MachinerySimulatorPanel getInstance(){
		if(instance == null){
			instance = new MachinerySimulatorPanel();
		}
		return instance;
	}

	public void setContentPanel(Panel contentPanel) {
		this.contentPanel = (MachineryPanel)contentPanel;
	}

	/**
	 * This is the default constructor
	 */
	public MachinerySimulatorPanel() {
		super(TITLE);
		this.setSize(Constant.PANEL_WIDTH, 740);
		CommonUtility.alignScreenCenter(this);
	}
	
	public void display(){
		this.setVisible(true);
	}
}
